import { defineStore } from 'pinia';
import {ref,reactive} from 'vue';
export const testStore = defineStore('storetest',() => {
   const person = reactive({
      name:'张三',
      age:18
  })
  const  num =  ref(100)
  const  changeNum = () => {
        num.value ++;
    }
    return {
       person,
        num,
        changeNum
    }
},{
    persist:true
})

export const shareStore = defineStore('store',() => {
    const is_show =  ref(false)
    const show = () => {
        // console.log(123)
        is_show.value = true;
    }
    const hide = () => {
        is_show.value = false;
    }
    return {
        is_show,
        show,
        hide
    }
})

export const mainStore = defineStore('video',() => {
    let src =  ref({})
    const changeSrc = (str) => {
        src.value = str;
    }
    return {
        src,
        changeSrc
    }
})
